<template>
  <section class="home-news-box">
    <div class="home-news-title">
      公司动态
      <router-link to='/news'>
        更多>
      </router-link>
    </div>

    <a :href='v.newsUrl'
       target="_blank"
       class="home-news-item"
       v-for="v,i in newsData"
       v-if="i<6">
      <div class="news-title">
        {{v.title}}
      </div>
      <div class="news-date">
        {{v.createTime}}
      </div>
    </a>
  </section>
</template>

<script>
export default {
  props: {
    newsData: {
      type: Array,
      default: [],
    },
  },
}
</script>

<style lang='scss'>
@import '@/theme/mixin';

.home-news-box {
  min-height: 240px;
  border-radius: 9px;
  margin-left: 20px;
  border: 1px solid #dedede;
  padding: 20px;
  box-sizing: border-box;
  color: #3e4651;
  .home-news-title {
    display: flex;
    justify-content: space-between;
    color: #0e1b2f;
    font-weight: 900;
    margin-bottom: 20px;
    font-style: 16px;
    span {
      font-size: 12px;
      color: $blue;
      cursor: pointer;
    }
  }
  .home-news-item {
    display: flex;
    justify-content: space-between;
    line-height: 26px;
    font-size: 14px;
    transition: all 0.5s;
  }
  .home-news-item:hover {
    cursor: pointer;
    .news-title {
      color: #345b90;
    }
  }
  .news-title {
    width: 500px;
    @include toverflow(1);
  }
  .news-date {
    font-style: 12px;
    color: #c5c7cb;
  }
}
</style>